Security and Authentication

Application-Wide Page Security

Description
This example shows how to enforce application-wide sign-in security without configuring sign-in on a page by page basis as is typical with role-based security.
Variables
Applies to
BasePage class
Code
 
''' 
''' Authorize function sets the access requirement of a page.
''' 
Public Overrides Sub Authorize(ByVal roles As String)
    If (IsNothing(roles) OrElse roles = "") Then
    
        ' If no login requirement specified on the page, default it to require login.
        MyBase.Authorize(BaseClasses.Utils.SystemUtils.ROLE_NOT_ANONYMOUS)        
    Else
    
        ' Else, use the login requirement specified on the page.
        MyBase.Authorize(roles)        
    End If    
End Sub

     

Terms of Service Privacy Statement